/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.oa.service;

import java.util.List;

import com.thinkgem.jeesite.modules.oa.entity.TravelApplication;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.oa.entity.LeaveApplication;
import com.thinkgem.jeesite.modules.oa.dao.LeaveApplicationDao;

/**
 * 请假单统计Service
 * @author xl
 * @version 2017-09-04
 */
@Service
@Transactional(readOnly = true)
public class LeaveApplicationService extends CrudService<LeaveApplicationDao, LeaveApplication> {

	public LeaveApplication get(String id) {
		return super.get(id);
	}
	
	public List<LeaveApplication> findList(LeaveApplication leaveApplication) {
		return super.findList(leaveApplication);
	}
	
	public Page<LeaveApplication> findPage(Page<LeaveApplication> page, LeaveApplication leaveApplication) {
		return super.findPage(page, leaveApplication);
	}
	
	@Transactional(readOnly = false)
	public void save(LeaveApplication leaveApplication) {
		super.save(leaveApplication);
	}
	
	@Transactional(readOnly = false)
	public void delete(LeaveApplication leaveApplication) {
		super.delete(leaveApplication);
	}



    public Page<LeaveApplication> findLeaveApplication(Page<LeaveApplication> page, LeaveApplication leaveApplication) {
        // 生成数据权限过滤条件（dsf为dataScopeFilter的简写，在xml中使用 ${sqlMap.dsf}调用权限SQL）
        leaveApplication.getSqlMap().put("dsf", dataScopeFilter(leaveApplication.getCurrentUser(), "o", "a"));
        // 设置分页参数
        leaveApplication.setPage(page);
        // 执行分页查询
        List<LeaveApplication> leaveApplications =super.findList(leaveApplication);

        page.setList(leaveApplications);
        return page;
    }
}